<%@ page import="cn.darkfire.web.POJO.User" %>
<%@ page import="java.util.Arrays" %>
<%@ page import="java.util.HashMap" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page import="java.util.Set" %><%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2022/10/12
  Time: 11:37
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<link rel="stylesheet" type="text/css" href="../static/css/bootstrap.css" />
<link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
<head>
    <title>信息展示</title>
</head>
<body>
<%
    HashMap<String,User> users = (HashMap<String, User>)session.getAttribute("users");
    // response.setHeader("Refresh", "3;URL=./destory.jsp");

%>
<center>
<c:if test="${empty users}">
    <h1>未登记！</h1>
</c:if>
<c:if test="${not empty users}">
    <h1>用户列表</h1>
    <div style="margin: 20px 200px">
        <table class="table table-striped table-bordered table-hover text-center">
        <thead>
        <tr style="vertical-align: middle;">
            <!--        th标签定义html表格中的表头单元格-->
            <th style="text-align:center;"> 姓名</th>
            <th style="text-align:center;padding-bottom: 13px">年龄</th>
            <th style="text-align:center;padding-bottom: 13px">爱好</th>
        </tr>
        </thead>
        <c:forEach items="${users}" var="user" varStatus="i">
            <tr>
                <td>${user.value.name}</td>
                <td>${user.value.age}</td>
                <td>
                    <c:forEach items="${user.value.hobbys}" var="hobby">
                            ${hobby}、
                    </c:forEach>
                </td>
            </tr>
        </c:forEach>
        </table>
    </div>
</c:if>
    <br>
    <a href="IdeaProjects/servlet_learn/web/sy3/index.html">返回首页</a>
    </center>
    </body>
    </html>
